// WhiteRect.cpp : implementation file
//

#include "stdafx.h"
#include "a1.h"
#include "WhiteRect.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CWhiteRect

CWhiteRect::CWhiteRect()
{
}

CWhiteRect::~CWhiteRect()
{
}


BEGIN_MESSAGE_MAP(CWhiteRect, CStatic)
	//{{AFX_MSG_MAP(CWhiteRect)
	ON_WM_PAINT()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CWhiteRect message handlers

void CWhiteRect::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
	CString str;
	this->GetWindowText(str);

	CRect rect;
	this->GetClientRect(&rect);
	dc.FillSolidRect(rect,RGB(254,254,254));
	if(str!="")
	{
	CFont* font=this->GetFont();
	dc.SetBkColor(RGB(254,254,254));

	dc.SelectObject(font);
	dc.TextOut(3,3,str);
	}

	dc.MoveTo(rect.left,rect.top);
	dc.LineTo(rect.left,rect.bottom);
	dc.MoveTo(rect.left,rect.top);
	dc.LineTo(rect.right,rect.top);

	COLORREF clrBtnShadow,clrBtnHilite,clrBtnDkShadow,clrBtnLight;
	clrBtnShadow = ::GetSysColor(COLOR_BTNSHADOW);
	clrBtnDkShadow = ::GetSysColor(COLOR_3DDKSHADOW);
	clrBtnLight = ::GetSysColor(COLOR_3DLIGHT);
	clrBtnHilite = ::GetSysColor(COLOR_BTNHIGHLIGHT);

	dc.DrawEdge(rect,EDGE_RAISED,BF_BOTTOM|BF_RIGHT);
}
